package cn.kbyue.security.security;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

import java.util.List;

/**
 * 自定义权限实体【角色, 权限列表】
 *
 * @author xl
 * @date 2020/4/19 18:25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DefinedGrantedAuthority implements GrantedAuthority {

    /**
     * 角色名或者代码
     */
    private String role;
    /**
     * 角色下的权限列表
     */
    private List<String> permission;

    @Override
    public String getAuthority() {
        return role;
    }
}
